# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>

pkgname=python-oslo-db
pkgver=12.3.2
_commit=62aff14693373842cd7a28a737ccbbf9bbdb1218
pkgrel=1
pkgdesc="OpenStack Database Pattern Library"
arch=('any')
url="https://pypi.python.org/pypi/oslo.db/$pkgver"
license=('Apache')
depends=('python-pbr' 'python-alembic' 'python-debtcollector' 'python-oslo-i18n'
         'python-oslo-config' 'python-oslo-utils' 'python-sqlalchemy' 'python-stevedore')
makedepends=('git' 'python-setuptools')
checkdepends=('python-testresources' 'python-testscenarios' 'python-eventlet' 'python-oslotest'
              'python-oslo-context' 'python-stestr' 'python-testtools' 'pifpaf')
optdepends=('python-testresources: for sqlalchemy test fixtures'
            'python-testscenarios: for sqlalchemy test fixtures')
options=('!emptydirs')
source=("git+https://github.com/openstack/oslo.db.git#commit=$_commit")
sha512sums=('SKIP')

prepare() {
  cd oslo.db
  # remove sqlalchemy-migrate
  git cherry-pick -n 94d6e24ca19b0116eed00d5ccdb8a538918c6dcf
}

build() {
  cd oslo.db
  python setup.py build
}

check() {
  cd oslo.db
  stestr run
}

package() {
  cd oslo.db
  python setup.py install --root="$pkgdir" --optimize=1
}

# vim:set ts=2 sw=2 et:
